<?php

class Moncada{
	static public function slugify($text){
		// sostituisce tutto tranne lettere e punti con -
		$text = preg_replace('/\W+/', '-', $text);
 
		// cancella gli spazi e converte in minuscolo
		$text = strtolower(trim($text, '-'));
 
		return $text;
	}
	
	static public function qprezzo($prezzo){
		switch ($prezzo){
			case 1:
			$value['min']=0;
			$value['max']=50000;
			break;
			case 2:
			$value['min']=50000;
			$value['max']=150000;
			break;
			case 3:
			$value['min']=150000;
			$value['max']=300000;
			break;
			case 4:
			$value['min']=300000;
			$value['max']=600000;
			break;
			case 5:
			$value['min']=600000;
			$value['max']=1000000;
			break;
			case 6:
			$value['min']=1000000;
			$value['max']=2000000;
			break;
			case 7:
			$value['min']=2000000;
			$value['max']=9999999;
			break;
			}
		return $value;
	}
	
	static public function qlung($lunghezza){
		switch ($lunghezza){
			case 1:
			$value['min']=0;
			$value['max']=10;
			break;
			case 2:
			$value['min']=10;
			$value['max']=20;
			break;
			case 3:
			$value['min']=20;
			$value['max']=30;
			break;
			case 4:
			$value['min']=30;
			$value['max']=40;
			break;
			case 5:
			$value['min']=40;
			$value['max']=50;
			break;
			case 6:
			$value['min']=50;
			$value['max']=60;
			break;
			case 7:
			$value['min']=60;
			$value['max']=100;
			break;
			case 7:
			$value['min']=100;
			$value['max']=9999;
			break;
			}
		return $value;
	}
	
	static public function qanno($anno){
		switch ($anno){
			case 1:
			$value['min']=1900;
			$value['max']=1930;
			break;
			case 2:
			$value['min']=1930;
			$value['max']=1960;
			break;
			case 3:
			$value['min']=1960;
			$value['max']=1990;
			break;
				}
		return $value;
	}
}

